package package1;

public class Num implements Intertest{
    int[] nums;
    public Num(int[] nums){
        this.nums=nums;
    }
    public Num(){
        this.nums=new int[]{1,2,3,4,5,6,7,8,9,10};
    }
    public void print(){
        for(int i=0;i<nums.length;i++){
            System.out.print(nums[i]+"!");
        }
        System.out.println();
    }
    @Override
    public void swap(int i, int j) {
        int temp=nums[i];
        nums[i]=nums[j];
        nums[j]=temp;
    }
    @Override
    public void reverse() {
        int left=0;
        int right=nums.length-1;
        while(left<right){
            swap(left,right);
            left++;
            right--;
        }
    }
}
